package com.czl.dxpro.dx_03_sta;
import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import com.czl.dxpro.dx_04_utils.TProperties;

public class DxStaTwoMapper extends Mapper<LongWritable,Text,Text,Text>{
	protected void map(LongWritable key, Text value, 
			Mapper<LongWritable, Text, Text, Text>.Context context)
			throws IOException, InterruptedException {
		// value:    0000000000000000| user id | pv
		//System.out.println(value);
		String[] values = value.toString().split(TProperties.getValue("fileoutsplit"));
		Text k = new Text(values[0]);
		Text v = new Text(values[1]+TProperties.getValue("outfilesplit")+values[2]);
		System.out.println("key~~~  "+k.toString());
		System.out.println("val~~~  "+v.toString());
		context.write(k,v);
		
		System.out.println("~~~~~mapper2");
	}

}
